package com.zlink.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author:Clarence
 * @date 2021/6/16 18:19
 * @motto Practice is the sole criterion for testing truth.
 */
@Configuration
public class ApplicationContextConfig {

    @Bean
    /**
     * 使用@LoadBalanced注解赋予RestTemplate负载均衡的能力
     * 自定义LoadBalanced，可注释掉
     * */
    //@LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
